package com.wewoo.log4e.starter.mongodb.spring.boot.autoconfigure;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

/**
 * @ClassName Log4eProperties
 * @Description TODO
 * @Author tangjin
 * @Date 16:05 2022/2/14
 **/
@RequiredArgsConstructor
@Getter
@Setter
@ConfigurationProperties(prefix = "log4e.mongodb")
public class Log4eMongoDBProperties {

    /**
     * 基础连接参数
     */
    private String database;
    private String username;
    private String password;
    private List<String> address;
    private String authenticationDatabase;

    /**
     * 客户端连接池参数
     */
    private String clientName;
    /**
     * socket连接超时时间
     */
    private int connectionTimeoutMs;
    /**
     * socket读取超时时间
     */
    private int readTimeoutMs;
    /**
     * 连接池获取链接等待时间
     */
    private int poolMaxWaitTimeMs;
    /**
     * 连接闲置时间
     */
    private int connectionMaxIdleTimeMs;
    /**
     * 连接最多可以使用多久
     */
    private int connectionMaxLifeTimeMs;
    /**
     * 心跳检测发送频率
     */
    private int heartbeatFrequencyMs;

    /**
     * 最小的心跳检测发送频率
     */
    private int minHeartbeatFrequencyMs;
    /**
     * 计算允许多少个线程阻塞等待时的乘数，算法：threadsAllowedToBlockForConnectionMultiplier*connectionsPerHost
     */
    private int threadsAllowedToBlockForConnectionMultiplier;
    /**
     * 心跳检测连接超时时间
     */
    private int heartbeatConnectionTimeoutMs;
    /**
     * 心跳检测读取超时时间
     */
    private int heartbeatReadTimeoutMs;

    /**
     * 每个host最大连接数
     */
    private int connectionsPerHost;
    /**
     * 每个host的最小连接数
     */
    private int minConnectionsPerHost;
}
